#include "stdafx.h"
#include "ckEnumOperator.h"
#include "zModule.h"

namespace ck
{
	EnumOperator::EnumOperator()
	{
	}


	EnumOperator::~EnumOperator()
	{
		Cleanup();
	}

	void EnumOperator::Add(Operator* pOperator)
	{
		if (pOperator)
		{
			m_opers.push_back(pOperator);
		}
	}

	void EnumOperator::Cleanup()
	{
		std::vector<Operator*>::iterator iter;
		for (iter = m_opers.begin(); iter != m_opers.end(); iter++)
		{
			//(*iter)->Release();
		}
		m_opers.clear();
	}

	void EnumOperator::Reset()
	{
		m_iter = m_opers.begin();
	}

	Operator* EnumOperator::Next()
	{
		if (m_iter == m_opers.end())
		{
			return NULL;
		}
		return *(m_iter++);
	}
}
